﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;

namespace fCloud.SensorApi.Models;
[Table("device")]
public class Device
{
    [Key]
    [Column("id")]
    public long Id { get; set; }

    [Column("create_at")]
    public DateTime? CreateAt { get; set; }

    [Column("modify_at")]
    public DateTime? ModifyAt { get; set; }

    [Column("name")]
    public string Name { get; set; }

    [Column("location")]
    public string Location { get; set; }

    [Column("mac")]
    public string Mac { get; set; }
    //
    // [Column("manufacture")]
    // public string Manufacture { get; set; }

    [Column("status")]
    public string Status { get; set; }

    [Column("gateway_id")]
    public long? GatewayId { get; set; }

    [Column("organization_id")]
    public long? OrganizationId { get; set; }

    [Column("t_name")]
    public string TName { get; set; }

    // [Column("description")]
    // public string Description { get; set; }

    [Column("supertable_name")]
    public string SupertableName { get; set; }

    // [Column("model")]
    // public string Model { get; set; }

    [Column("type")]
    public string Type { get; set; }

    // [Column("install_date")]
    // public DateTime? InstallDate { get; set; }

    [Column("loc_lat")]
    public double? LocLat { get; set; }

    [Column("loc_lon")]
    public double? LocLon { get; set; }

    // [Column("update_status")]
    // public UpdateStatus UpdateStatus { get; set; }
    //
    // [Column("update_time")]
    // public DateTime? UpdateTime { get; set; }
    //
    // [Column("current_version")]
    // public string CurrentVersion { get; set; }
    //
    // [Column("next_version")]
    // public string NextVersion { get; set; }
    //
    // [Column("file_path")]
    // public string FilePath { get; set; }
    //
    // [Column("update_result")]
    // public string UpdateResult { get; set; }
    //
    // [Column("device_type_id")]
    // public long? DeviceTypeId { get; set; }

    [Column("oil_id")]
    public long? OilId { get; set; }

    // [Column("email")]
    // public string Email { get; set; }
    //
    // [Column("phone")]
    // public string Phone { get; set; }
}
public enum UpdateStatus
{
    [Display(Name = "NONE")]
    None = 0,
    
    [Display(Name = "PREPARE")]
    Prepare = 1,
    
    [Display(Name = "DONE")]
    Done = 2
}